ngx.req.read_body()

local args, err = ngx.req.get_uri_args()
local http = require "http"
local httpc = http.new()

-- for k,v in pairs(args) do
--   ngx.say("[GET] key: ", k," value: ",v)
--   ngx.say("<br/>")
--   ngx.say(args.data)
-- end

local res, err = httpc:request_uri(
  "http://127.0.0.1/spe_md5",
  {
    method = "POST",
    body = args.data,
  }
)

if 200 ~= res.status then
  ngx.exit(res.status)
end

ngx.say(res.body)

if args.key == res.body then
  ngx.say("valid request")
else
  ngx.say("invalid request")
end



